<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
      		var ar=["America","greece","Britain","Canada","China"];
      		var c=0;
      for (var i in ar) {
      	document.write(ar[i]+"<br/>");
    	if(ar[i].indexOf("a")!=-1||ar[i].indexOf("A")!=-1){
  	 	 c++;
   }
      }
     	document.write("a共出现在"+c+"个字符串中");
		</script>
	</body>
</html>
